﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Controls;

namespace Ares.Engine.Lib
{
    public interface IBackUpStorage
    {
        #region Saving
        void InitSaveTransaction(ref BackupProject project, ref BackupProtocol protocol);

        void SaveEntry(BackupEntry Entry, FileInfo fileInfo, Stream dataStream);

        void EndSaveTransaction();
        #endregion

        #region Revert
        void InitRevertTransaction();

        void RevertEntry();

        void EndRevertTransaction();
        #endregion

        DateTime GetLastProtocolDate();

        List<BackupProtocol> GetAllProtocols();

        string Name { get; }

        string FileName { get; }

        BackupProtocol GetLastFullProtocol(BackupProject project);

        BackupProtocol GetLastIncrementalProtocol(BackupProject project);

        Stream GetStreamFromFile(ref BackupProject CurrentBackupProject, ref BackupProtocol LastFullBackupProtocol, String FilePath, String FileHash);
        void ReleaseStream(string SourcePath);

        uint GetLastProtocolID();

        void SetBackupProject(BackupProject project);

        IHost host { get; set; }

        BackupProtocol GetProtocolByID(ref BackupProject CurrentBackupProject, uint ToID);

        void RevertEntry(ref BackupProtocol protocol, BackupEntry entry, ref FileInfo fileInfo, ref Stream fileStream);
    }
}
